﻿/******************************************************************************
 *
 * @copyright:          Copyright 2011 UniSky Ltd.
 * @file:
 * @author:              kenping.liu
 * @creation:
 * @description:
 *
 * @modifications
 * date         user                description
 *
 *
 * @more-details
 *
 *****************************************************************************/
#ifndef _UNISKY_HLS_H_
#define _UNISKY_HLS_H_

#include "../u_inc.h"

U_NAMESPACE_BEGIN(u)
U_NAMESPACE_BEGIN(hls)

typedef struct _st_stream_ts_
{
    UINT inf;
    char path[MAX_PATH];
}STREAM_TS;

typedef struct _st_stream_m3u8_
{
    UINT    bandwidth;
    char    path[MAX_PATH];
    
    UINT    duration;
    UINT    sequence;

    UINT        ts_pattren[MAX_PATH];
    UINT        ts_count;
    STREAM_TS   ts_file[10];
}STREAM_M3U8;

typedef struct _st_idx_program_
{
    UINT        stmcnt;
    STREAM_M3U8 streams[10];
}PROGRAM_M3U8;

class M3U8
{
public:
    static void parse_program(PROGRAM_M3U8* program, const char* content);
    static void parse_stream(STREAM_M3U8* stream, const char* content);
};

U_NAMESPACE_END(hls)
U_NAMESPACE_END(u)

#endif
